function checkProject_name() {
    var project_name = document.myform.project_name.value;
    var project_nametab = document.getElementById('project_nametab');
    if(/^[\u4e00-\u9fa5_a-zA-Z0-9]{2,18}$/.test(project_name)){
        project_nametab.innerHTML = '√';
        project_nametab.style.color = '#0a0';
        return true;
    }else{
        project_nametab.innerHTML = '×';
        project_nametab.style.color = '#f00';
        return false;
    }
}

function project_startname() {
    var project_start_name = document.myform.project_start_name.value;
    var project_start_nametab = document.getElementById('project_start_nametab');
    if(/^[\u4e00-\u9fa5_a-zA-Z0-9]{2,18}$/.test(project_start_name)){
        project_start_nametab.innerHTML = '√';
        project_start_nametab.style.color = '#0a0';
        return true;
    }else{
        project_start_nametab.innerHTML = '×';
        project_start_nametab.style.color = '#f00';
        return false;
    }
}


function projectprice() {
    var project_price = document.myform.project_price.value;
    var project_pricetab = document.getElementById('project_pricetab');
    if(/^[0-9.]{1,12}$/.test(project_price)){
        project_pricetab.innerHTML = '√';
        project_pricetab.style.color = '#0a0';
        return true;
    }else{
        project_pricetab.innerHTML = '×';
        project_pricetab.style.color = '#f00';
        return false;
    }
}


function projectaddress() {
    var project_address = document.myform.project_address.value;
    var project_addresstab = document.getElementById('project_addresstab');
    if(/^[\u4e00-\u9fa5_a-zA-Z0-9]{2,18}$/.test(project_address)){
        project_addresstab.innerHTML = '√';
        project_addresstab.style.color = '#0a0';
        return true;
    }else{
        project_addresstab.innerHTML = '×';
        project_addresstab.style.color = '#f00';
        return false;
    }
}

function constructioncontent() {
    var construction_content = document.myform.construction_content.value;
    var construction_contenttab = document.getElementById('construction_contenttab');
    if(/^[\u4e00-\u9fa5_a-zA-Z0-9]+$/.test(construction_content)){
        construction_contenttab.innerHTML = '√';
        construction_contenttab.style.color = '#0a0';
        return true;
    }else{
        construction_contenttab.innerHTML = '×';
        construction_contenttab.style.color = '#f00';
        return false;
    }
}

function buildunit() {
    var build_unit = document.myform.build_unit.value;
    var build_unittab = document.getElementById('build_unittab');
    if(/^[\u4e00-\u9fa5_a-zA-Z0-9]{2,18}$/.test(build_unit)){
        build_unittab.innerHTML = '√';
        build_unittab.style.color = '#0a0';
        return true;
    }else{
        build_unittab.innerHTML = '×';
        build_unittab.style.color = '#f00';
        return false;
    }
}

function constructionunit() {
    var construction_unit = document.myform.construction_unit.value;
    var construction_unittab = document.getElementById('construction_unittab');
    if(/^[\u4e00-\u9fa5_a-zA-Z0-9]{2,18}$/.test(construction_unit)){
        construction_unittab.innerHTML = '√';
        construction_unittab.style.color = '#0a0';
        return true;
    }else{
        construction_unittab.innerHTML = '×';
        construction_unittab.style.color = '#f00';
        return false;
    }
}

function projectcontractname() {
    var project_contract_name = document.myform.project_contract_name.value;
    var project_contract_nametab = document.getElementById('project_contract_nametab');
    if(/^[\u4e00-\u9fa5_a-zA-Z0-9]{2,18}$/.test(project_contract_name)){
        project_contract_nametab.innerHTML = '√';
        project_contract_nametab.style.color = '#0a0';
        return true;
    }else{
        project_contract_nametab.innerHTML = '×';
        project_contract_nametab.style.color = '#f00';
        return false;
    }
}


function maketspan()
{
    var start_time = document.myform.start_time.value;
    var makespan = document.myform.makespan.value;
    var makespantab = document.getElementById('makespantab');
    if( start_time < makespan ){
        makespantab.innerHTML = '√';
        makespantab.style.color = '#0a0';
        return true;
    }else{
        makespantab.innerHTML = '×';
        makespantab.style.color = '#f00';
        return false;
    }
}



// 表单提交验证
function checkForm() {
    return checkProject_name() && project_startname() && projectprice() && projectaddress() && constructioncontent() && buildunit() && constructionunit() && project_contractname() && projectcontractname() && maketspan();
}